// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
// 定义 API 路径枚举
enum Api {
    SysOrgAdd = '/sysOrg/AddOrg',
    SysOrgDelete = '/sysOrg/DeleteOrg',
    SysOrgList = '/sysOrg/list',
    SysOrgUpdate = '/sysOrg/UpdateOrg',
}

// 定义 API 方法
export const apiSysOrgAddPost = (body?: any) =>
    request({
        url: Api.SysOrgAdd,
        method: 'post',
        data: body,
    });

export const apiSysOrgDeletePost = (body?: any) =>
    request({
        url: Api.SysOrgDelete,
        method: 'delete',
        data: body,
    });

export const apiSysOrgListGet = (id: number, name?: string, code?: string, type?: string) =>
    request({
        url: `${Api.SysOrgList}?Id=${id}&Name=${name ?? ''}&Code=${code ?? ''}&Type=${type ?? ''}`,
        method: 'get',
    });

export const apiSysOrgUpdatePost = (body?: any) =>
    request({
        url: Api.SysOrgUpdate,
        method: 'put',
        data: body,
    });